package com.huang825172.sbog.Util;

import android.content.Context;

public class VideoFileCacheManager {

    public class VideoItem{
        public int id;
        public String url;
        public VideoItem(int id, String url){
            this.id = id;
            this.url = url;
        }
    }

    private StatusCacheUtil statusCacheUtil;
    private int pageCount;
    private int countCursor;

    public VideoFileCacheManager(Context context){
        statusCacheUtil = new StatusCacheUtil("videoCacheStatus",context);
        pageCount = 1;
        countCursor = 1;
    }

    public void newPage(){
        pageCount++;
    }

    public int addToCache(String filePath, int id){
        statusCacheUtil.put(String.valueOf(pageCount)+"-"+String.valueOf(countCursor),filePath);
        return countCursor++;
    }

    public String getVideo(int index){
        return statusCacheUtil.getAsString(String.valueOf(pageCount)+"-"+String.valueOf(index));
    }

    public String getVideo(int page, int index){
        return statusCacheUtil.getAsString(String.valueOf(page)+"-"+String.valueOf(index));
    }

}
